package com.ad.pet.ui;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.ad.pet.R;

/**
 * Created by SEELE on 2019/7/2.
 */

public class KefuDialog extends Dialog {

    public KefuDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);



        initView(context);
    }

    private void initView(Context context){
        View view = View.inflate(context, R.layout.layout_kefu_dialog,null);




        setContentView(view);
        Window window = this.getWindow();
        WindowManager.LayoutParams lp = window.getAttributes();
        lp.width = (context.getResources().getDisplayMetrics().widthPixels *  8/ 10); // 设置宽度
        this.getWindow().setAttributes(lp);
        window.setGravity(Gravity.CENTER);


    }


}
